package com.js.rtu.greendao.db;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.ToMany;
import org.greenrobot.greendao.annotation.Unique;

import java.io.Serializable;
import java.util.List;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.DaoException;
import com.js.rtu.greendao.dao.DaoSession;
import com.js.rtu.greendao.dao.HistoryBeanDao;
import com.js.rtu.greendao.dao.HistoryInfoBeanDao;

@Entity
public class HistoryInfoBean   {
    @Id(autoincrement = true)
    public Long id;
    public String startTime;//补调开始时间
    public String endTime;//补调结束时间
    public String interval;//间隔
    public String total;//循环次数

    @Unique
    private Long operaTime;//查询时间
    public String cmd;//指令
    public String deviceId;//设备ID
    public String config92;//92指令回复数据


    @ToMany(referencedJoinProperty = "time")
    private List<HistoryBean> mHistoryBeanList;
    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;
    /** Used for active entity operations. */
    @Generated(hash = 554155530)
    private transient HistoryInfoBeanDao myDao;


    @Generated(hash = 925263121)
    public HistoryInfoBean(Long id, String startTime, String endTime,
            String interval, String total, Long operaTime, String cmd,
            String deviceId, String config92) {
        this.id = id;
        this.startTime = startTime;
        this.endTime = endTime;
        this.interval = interval;
        this.total = total;
        this.operaTime = operaTime;
        this.cmd = cmd;
        this.deviceId = deviceId;
        this.config92 = config92;
    }


    @Generated(hash = 100025338)
    public HistoryInfoBean() {
    }


    public Long getId() {
        return this.id;
    }


    public void setId(Long id) {
        this.id = id;
    }


    public String getStartTime() {
        return this.startTime;
    }


    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }


    public String getEndTime() {
        return this.endTime;
    }


    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }


    public String getInterval() {
        return this.interval;
    }


    public void setInterval(String interval) {
        this.interval = interval;
    }


    public String getTotal() {
        return this.total;
    }


    public void setTotal(String total) {
        this.total = total;
    }


    public Long getOperaTime() {
        return this.operaTime;
    }


    public void setOperaTime(Long operaTime) {
        this.operaTime = operaTime;
    }


    public String getCmd() {
        return this.cmd;
    }


    public void setCmd(String cmd) {
        this.cmd = cmd;
    }


    public String getDeviceId() {
        return this.deviceId;
    }


    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }


    public String getConfig92() {
        return this.config92;
    }


    public void setConfig92(String config92) {
        this.config92 = config92;
    }


    /**
     * To-many relationship, resolved on first access (and after reset).
     * Changes to to-many relations are not persisted, make changes to the target entity.
     */
    @Generated(hash = 213145997)
    public List<HistoryBean> getMHistoryBeanList() {
        if (mHistoryBeanList == null) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            HistoryBeanDao targetDao = daoSession.getHistoryBeanDao();
            List<HistoryBean> mHistoryBeanListNew = targetDao
                    ._queryHistoryInfoBean_MHistoryBeanList(id);
            synchronized (this) {
                if (mHistoryBeanList == null) {
                    mHistoryBeanList = mHistoryBeanListNew;
                }
            }
        }
        return mHistoryBeanList;
    }


    /** Resets a to-many relationship, making the next get call to query for a fresh result. */
    @Generated(hash = 1226388432)
    public synchronized void resetMHistoryBeanList() {
        mHistoryBeanList = null;
    }


    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }


    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }


    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }


    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1623419406)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getHistoryInfoBeanDao() : null;
    }



}
